package com.charity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.charity.domain.Project;
import com.charity.domain.Volunteer;
import org.apache.ibatis.annotations.Param;

public interface VolunteerMapper extends BaseMapper<Volunteer> {
    /**
     * 检查志愿者是否已参与项目
     */
    boolean checkVolunteerProjectExists(@Param("volunteerId") Long volunteerId, @Param("projectId") Long projectId);

    /**
     * 添加志愿者项目关联
     */
    int insertVolunteerProject(@Param("volunteerId") Long volunteerId, @Param("projectId") Long projectId);

    /**
     * 删除志愿者项目关联
     */
    int deleteVolunteerProject(@Param("volunteerId") Long volunteerId, @Param("projectId") Long projectId);

    /**
     * 查询志愿者参与的项目列表
     */
    Page<Project> selectVolunteerProjects(@Param("volunteerId") Long volunteerId, @Param("page") Page<Project> page);
}